@extends('admin.home.main')

@section('body')
<section id="main-content">

<section class="wrapper">
<h3>反馈列表</h3>
<hr>
<div class="row mt">
  <div class="col-md-12">
  <form action="/admin/question/list" method="get">
    <input type="hidden" name="action" value="search">
    
    <select size="1" name="page_size" aria-controls="hidden-table-info" style="width:80px; height:34px;float:left; " class="form-control">
      <option value="0">请选择</option>
      @foreach($page_size_list as $ptm=>$pst)
        @if($pst == $page_size)
        <option value="{{$pst}}" selected="selected">{{$pst}}</option>
        @else
        <option value="{{$pst}}">{{$pst}}</option>
        @endif
      @endforeach
    </select>

    <input type="text" style="width:200px;float:left; margin-left:10px;" class="form-control" placeholder="请输入用户微信昵称或电话" name="keywords" id="keywords" value="{{$keywords}}">
    <button type="submit" id="search" style="float:left; margin-left:10px;" class="btn btn-success">搜索</button>
  </form>
  </div>
</div>


<!-- row -->
<div class="row mt">
  <div class="col-md-12">
    <div class="content-panel">
      <table class="table table-striped table-advance table-hover">
        <thead>
          <tr>
          	<th>#</th>
            <th>反馈内容</th>
            <th>反馈用户</th>
            <th>用户手机</th>
            <th>提交时间</th> 
            <th>操作</th>
          </tr>
        </thead>
        <tbody>
          @foreach($qlist as $qtm=>$qst)
          <tr>
            <td>{{$qst->id}}</td>
            <td>{{$qst->content}}</td>
            <td>{{$qst->member_name}}</td>
            <td>{{$qst->telephone}}</td>
            <td>{{$qst->add_date}}</td>
            <td><button type="botton" colid="{{$qst->id}}" class="btn btn-danger btn-xs col_del">删除</button></td>
          </tr>
          @endforeach
        </tbody>
      </table>
    </div>
    <!-- /content-panel -->
    <div class="row-fluid">

      <div class="span6">
        <div class="dataTables_paginate paging_bootstrap pagination">
          <ul>{!! $qlist->render() !!}</ul>
        </div>
      </div>
    </div>
  </div>
  <!-- /col-md-12 -->
</div>
<!-- /row -->
</section>
</section>
<script type="text/javascript">
	$('.col_del').click(function(){
		var _colId = $(this).attr('colid');
		var a = confirm('请确认是否要删除该信息');
		var t = $(this).parent().parent();

		if(a == true){
			$.ajax({
				'type':'get',
				'url':'/admin/feedback/del/'+_colId,
				'dataType':'json',
				success:function(msg){
					if(msg.code == 200){
						alert('删除成功');
					}else{
						alert('删除失败');
					}
					location.reload();
				}
			})
		}
	})

</script>
@endsection